﻿namespace SharpF2
{
	using System.Windows;
	using System.Windows.Threading;
	using Services;

	/// <summary>
	/// Define the application startup
	/// </summary>
	public partial class App
	{
		#region Private Members

		private static void AppDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
		{
			WebServices.Instance.ReportException(e.Exception);
			e.Handled = true;
		}

		#endregion

		#region Protected Members

		protected override void OnStartup(StartupEventArgs e)
		{
			base.OnStartup(e);

			Current.DispatcherUnhandledException += AppDispatcherUnhandledException;

			Resources["Args"] = e.Args;
		}

		#endregion
	}
}